﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="EmpresaNivMadurezActualGest.aspx.cs" Inherits="AudiPyme.UI.EmpresaNivMadurezActualGest"
    EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Panel ID="PanelOpciones" runat="server">
        <ul class="list1">
            <li><a href="EmpresaNivMadurezPrincipal.aspx">Nivel Madurez Principal</a></li>
        </ul>
    </asp:Panel>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id='basic-modal' style="text-align: right">
        <a href='#' class='basic'>
            <img src="/Images/Icono_ayuda.jpg" alt="Pinche para ver un video tutorial de la página"
                width="30 " height="30" border="0"></a>
    </div>
    <!-- modal content -->
    <div id="basic-modal-content">
        <iframe width="853" height="480" src="http://www.youtube.com/embed/msSrLhZzXdc" frameborder="0"
            allowfullscreen></iframe>
    </div>
    <!-- preload the images -->
    <div style='display: none'>
        <img src='Images/x.png' alt='' />
    </div>
    <script type="text/javascript">
        function expandDetailsInGrid(_this) {
            var id = _this.id;
            var imgelem = document.getElementById(_this.id);
            var currowid = id.replace("A_View", "TR_Summmary") //Coge el Id la fila seleccionada

            var rowdetelemid = currowid;
            var rowdetelem = document.getElementById(rowdetelemid);
            if (imgelem.alt == "plus") {
                imgelem.src = "/Images/minus.gif"
                imgelem.alt = "minus"
                rowdetelem.style.display = 'table-row';
            }
            else {
                imgelem.src = "/Images/plus.gif"
                imgelem.alt = "plus"
                rowdetelem.style.display = 'none';
            }

            return false;

        }
    </script>
    <h2>
        Nivel Madurez Actual: Calcular<asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
    </h2>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:Panel ID="PnlGV" runat="server">
                <h4>
                    <asp:Label ID="LblNumContr" runat="server" Text="Número de Controles Seleccionados:"></asp:Label>
                    <asp:Label ID="LblControl" runat="server" CssClass="alignright" Text="0" Width="30px"></asp:Label>
                    <asp:Label ID="LblBarra" runat="server" Text="/"></asp:Label>
                    <asp:Label ID="LblNTotContr" runat="server" Text="0"></asp:Label>
                </h4>
                <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
                    AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging"
                    CssClass="myDatagrid">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="A_View" runat="server" AlternateText="plus" ImageUrl="~/Images/plus.gif"
                                    OnClientClick="expandDetailsInGrid(this);return false;" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="IdControl" HeaderText="Id Control" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="IdObjControl" HeaderText="Id ObjControl" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="Codigo" HeaderText="Código" ItemStyle-HorizontalAlign="Center" />
                        <asp:BoundField DataField="Nombre" HeaderText="Nombre" />
                        <asp:BoundField DataField="NivelMadurez" HeaderText="Madurez" ItemStyle-HorizontalAlign="Center" />
                        <asp:TemplateField>
                            <HeaderTemplate>
                                <asp:Label ID="LblToolOpciones" runat="server" Text="Respuesta" ToolTip='Seleccione una de las respuestas por cada control'></asp:Label>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:RadioButtonList ID="RadioButtonList1" runat="server" witdh="auto" AutoPostBack="true"
                                    OnSelectedIndexChanged="Index_Changed">
                                    <asp:ListItem Value="SI">SI</asp:ListItem>
                                    <asp:ListItem Value="NO">NO</asp:ListItem>
                                    <asp:ListItem Value="PARCIALMENTE">PARC</asp:ListItem>
                                    <asp:ListItem Value="NO APLICA">N/A</asp:ListItem>
                                </asp:RadioButtonList>
                                </td> </tr>
                                <tr id="TR_Summmary" runat="server" style="display: none">
                                    <td colspan="7">
                                        <table>
                                            <tr>
                                                <td>
                                                </td>
                                                <td>
                                                    <asp:Label ID="Label1" runat="server" Text='<%#Eval("Descripcion")%>'></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
                <br />
                <asp:Button ID="BtnInsertar" runat="server" OnClick="BntControl_Click" Text="Insertar"
                    Enabled="False" Visible="False" Width="80px" />
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
